package com.fenxiangle.yueding.feature.mine.view.adapter;

import android.support.annotation.Nullable;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fenxiangle.yueding.R;
import com.fenxiangle.yueding.entity.bo.GenreClassBo;
import com.fenxiangle.yueding.entity.bo.GenreSeedBo;
import com.fenxiangle.yueding.entity.bo.OccupationBo;

import java.util.List;

/**
 * Created by Home on 2018/9/2.
 */

public class RequirementGenreSendAdapter extends BaseQuickAdapter<OccupationBo.SecondBean, BaseViewHolder> {

    private int selectItem = 0;

    public RequirementGenreSendAdapter(@Nullable List<OccupationBo.SecondBean> data) {
        super(R.layout.item_send, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OccupationBo.SecondBean item) {
        TextView layout_send = helper.getView(R.id.item_send_name);
        if (getSelectItem() == helper.getAdapterPosition()) {
            layout_send.setSelected(true);
        } else {
            layout_send.setSelected(false);
        }
        helper.setText(R.id.item_send_name, item.getOccupation());
    }

    public int getSelectItem() {
        return selectItem;
    }

    public void setSelectItem(int selectItem) {
        this.selectItem = selectItem;
    }
}
